home *** CD-ROM | disk | FTP | other *** search
/ Delphi Informant Complete 1995 - 2000 / Delphi Informant Complete 1995 to 2000.iso / Delphi Informant Magazine Complete Works SOURCE CODE 1995.rar / 1995 / NOV / CJ9511 / brunit1.pas < prev    next >
Pascal/Delphi Source File  |  1995-09-27  |  1KB  |  62 lines

  1. unit Brunit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, Grids, DBGrids, DB, DBTables, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Label1: TLabel;
  12.     Label2: TLabel;
  13.     Edit1: TEdit;
  14.     Edit2: TEdit;
  15.     Button1: TButton;
  16.     DataSource1: TDataSource;
  17.     Table1: TTable;
  18.     DBGrid1: TDBGrid;
  19.     Button2: TButton;
  20.     BatchMove1: TBatchMove;
  21.     Table2: TTable;
  22.     DataSource2: TDataSource;
  23.     StoredProc1: TStoredProc;
  24.     Query1: TQuery;
  25.     SaveDialog1: TSaveDialog;
  26.     procedure Button1Click(Sender: TObject);
  27.     procedure Button2Click(Sender: TObject);
  28.   private
  29.     { Private declarations }
  30.   public
  31.     { Public declarations }
  32.   end;
  33.  
  34. var
  35.   Form1: TForm1;
  36.  
  37. implementation
  38.  
  39. {$R *.DFM}
  40.  
  41. procedure TForm1.Button1Click(Sender: TObject);
  42. begin
  43. with Table1 do
  44.   begin
  45.   EditRangeStart; { Set the beginning key }
  46.   Fields[0].AsInteger := StrToInt(Edit1.Text);
  47.   EditRangeEnd; { Set the ending key }
  48.   Fields[0].AsInteger := StrToInt(Edit2.Text);
  49.   ApplyRange; { Tell the dataset to establish the range }
  50.   end;
  51. end;
  52.  
  53. procedure TForm1.Button2Click(Sender: TObject);
  54. begin
  55. if SaveDialog1.Execute then begin
  56.   Table2.Tablename := SaveDialog1.Filename;
  57.   BatchMove1.Execute;
  58. end;
  59. end;
  60.  
  61. end.
  62.